export enum RoleManageEvent {
  REFRESHROLES,
  EDITCURRENTROLE,
  DELCURRENTROLE,
}

export interface Permission {
  resource_id: string;
  resource_type: string;
  action: string;
}

export interface ConditionItem {
  param: string;
  op: string;
  value: string | number | boolean;
}

export interface Condition {
  name: string;
  condition: ConditionItem[];
}

export interface Role {
  id: string;
  code: string;
  name: string;
  description: string;
  statements: Condition[];
  permissions: Permission[];
  children: Role[];
  adminList?: string[][];
  readList?: string[][];
  folder_name?: string;
  is_sub_admin?: boolean;
  allocation?: string;
}

export interface CdtMetaOps {
  key: string;
  desc: string;
  data_type: string;
}

export interface CdtMetaParam {
  id: string;
  key: string;
  label: string;
  data_type: string;
  values: string[];
}

export interface CdtMetaData {
  params_description: string;
  condition_description: string;
  ops: CdtMetaOps[];
  params: CdtMetaParam[];
}

export interface RoleParentId {
  parent_id: string;
}
